//
//  HttpConfig.h
//  Edu_iOS2018
//
//  Created by apple on 2018/1/5.
//  Copyright © 2018年 yanyan. All rights reserved.
//

#ifndef HttpConfig_h
#define HttpConfig_h
#import "KHAccess_Settings.h"
#define URL_SERVER_HEADER_USERTOKEN_KEY @"X-AUTH-TOKEN"

#define URL_SERVER  @"http://app.xueyuanwang.com/api/"//@"http://app.sdkhcm.com/api/"
//#define URL_SERVER  @"http://192.168.1.212/api/"
//[KHAccess_Settings urlBaseString] //


//  *****************************登录\注册**********************************  //
//根据userid判断(QQ WX)是否已经进行绑定
#define URL_POST_Bind_login                         URL_SERVER @"users/bind_login"

//绑定操作(我的--账户安全--绑定操作) 与登录注册绑定区分开
#define URL_POST_SettingBind                        URL_SERVER @"me/setting/bind"

//解绑
#define URL_POST_Unbind                             URL_SERVER @"me/setting/unbind"

//注册接口
#define URL_POST_Users                              URL_SERVER @"users"

//获取验证码
#define URL_POST_SmsCodes                           URL_SERVER @"smsCodes"

//登录
#define URL_POST_Login                              URL_SERVER @"users/login"

//退出登录
#define URL_POST_Logout                             URL_SERVER @"users/logout"

//忘记密码
#define URL_POST_ResetPwd                           URL_SERVER @"users/resetPwd"

//验证手机短信验证码 (忘记密码的"下一步"按钮)
#define URL_POST_CheckSmsCode                       URL_SERVER @"smsCodes/checkSmsCode"

//注册隐私协议mobileschools/terms
#define URL_GET_Mobileschools                       URL_SERVER @"mobileschools/terms"

//扫一扫 请求类型以及url


//  *****************************我的**********************************  //
//我的课程(参数:relation 值:learning:在学课程，learned:已学完，favorited：收藏)
#define URL_GET_Me_Courses                          URL_SERVER @"me/courses"

//我的资料
#define URL_GET_Me                                 URL_SERVER @"me"

//我的头像
#define URL_POST_Me_Avatar                          URL_SERVER @"me/avatar"

//课程评价
#define URL_GET_Reviews                             URL_SERVER @"me/course/reviews"

//修改个人资料(参数 'truename<真实姓名>','gender<性别>','birthday<生日>','signature<个签>','intro<自我介绍>')
#define URL_POST_MeSetting                          URL_SERVER @"me/setting"

//修改-or-绑定 ---> 手机号update/password
#define URL_POST_UpdateMobile                       URL_SERVER @"update/mobile"

//第一次设置登录密码me/setting/password
#define URL_POST_SetPassword                        URL_SERVER @"me/setting/password"

//修改登录密码update/nickname
#define URL_POST_UpdatePassword                     URL_SERVER @"update/password"

//修改用户名(可直接用于登陆)
#define URL_POST_UpdateNickname                     URL_SERVER @"update/nickname"

//修改用户名(可直接用于登陆)
#define URL_POST_CheckMobile                        URL_SERVER @"me/setting/mobile"


//私信列表messages
#define URL_GET_Mine_Messages                       URL_SERVER @"messages/"

//私信详情 在私信列表接口后面拼接id
#define URL_GET_Mine_Messages_DetailWithId(personId)   [[URL_SERVER stringByAppendingString:@"messages/"]stringByAppendingString:(personId)]
//收藏课程
#define URL_POST_Favroite(courseId)                 [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"courses/%@/favroite",(courseId)]]

//(批量)取消收藏
#define URL_POST_CancelFavroite                     URL_SERVER @"courses/unfavroite"

//系统通知notifications
#define URL_GET_SystemNotifications                 URL_SERVER @"notifications"
//系统通知详情
#define URL_GET_SystemNotiDetail(batchId)           [[URL_SERVER stringByAppendingString:@"notifications/"]stringByAppendingString:(batchId)]

//热门搜索-列表
#define URL_GET_HotSearch                           URL_SERVER @"tags"

//  *****************************视频播放器**********************************  //
//视频已学完发送状态(此接口 调用 <课程详情>接口 然后在拼接<课时> 在此声明)
#define URL_CourseDetailWithId(courseId)   [[URL_SERVER stringByAppendingString:@"courses/"]stringByAppendingString:(courseId)]
//courses/343/120
//视频已学完发送学习时长(此接口 调用 <课程详情>接口 然后在拼接<lessonid/time> 在此声明)
#define URL_POST_CourseDetailTimeWith(lessonId)   [[URL_SERVER stringByAppendingString:@"courses/"]stringByAppendingString:(lessonId)]

#pragma mark - 分类-
#define URL_AllCategory   [URL_SERVER stringByAppendingString:@"category"]
// 订单详情
#define URL_CourseOrderDetailWithId(orderId)   [[URL_SERVER stringByAppendingString:@"orders/"]stringByAppendingString:(orderId)]
 //课程详情
#define URL_CourseDetailWithId(courseId)   [[URL_SERVER stringByAppendingString:@"courses/"]stringByAppendingString:(courseId)]
//课程目录courses/**/units
#define URL_GET_CourseUnitsWithId(courseId)   [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"courses/%@/units",(courseId)]]

// 加入学习courses/54/member
#define URL_CourseMemberWithId(courseId)   [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"courses/%@/member",(courseId)]]
// 生成订单号
#define URL_OrderSnWithCourceId(courseId)   [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"courses/%@/order",(courseId)]]

// 一个课程评价列表
#define URL_CourseCommentListWithId(courseId) [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"courses/%@/review",(courseId)]]
//  订单里面的去评价
#define URL_ToCourseCommentWithId(courseId) [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"courses/%@/review",(courseId)]]

// 订单- 我的订单 -取消订单
#define URL_CancelCourseOrderWithId(orderId) [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"me/orders/%@/cancel",(orderId)]]
/**分类课程get
 * categoryId    分类id ;
 * start    开始数目 ;
   limit    每页个数;
    sort    排序 ;popular：人气，priceDesc：价格 降序，priceAsc：价格升序
       q    关键词搜索        语文
 */

#define URL_CourseOfCategory   [URL_SERVER stringByAppendingString:@"courses"]
// 首页
#define URL_AllOfHome   [URL_SERVER stringByAppendingString:@"mobileschools/home"]
// 课程订单
#define URL_CourseOrderList [URL_SERVER stringByAppendingString:@"me/orders"]
//按照支付方式  支付订单
#define URL_CommitOrderWithOrderId(orderId)  [URL_SERVER stringByAppendingString:[NSString stringWithFormat:@"orders/%@",(orderId)]]

#endif /* HttpConfig_h */
